package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.WorkerOperateType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/5/11 13:21
 * @description : 工单处理记录
 */
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "worker_order_resolve_record")
public class WorkerOrderResolveRecordEntity extends BaseEntity{
    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(name = "id", unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(name = "worker_order_id", columnDefinition = ("varchar(40) not null comment '工单id'"))
    private String workerOrderId;

    @Column(name = "resolve_time", columnDefinition = ("datetime not null comment '处理时间'"))
    private LocalDateTime resolveTime;

    @Column(name = "resolver", columnDefinition = ("varchar(40) not null comment '处理人'"))
    private String resolver;

    @Column(name = "resolve_operate", columnDefinition = ("varchar(32) not null comment '处理操作'"))
    @Enumerated(EnumType.STRING)
    private WorkerOperateType workerOperateType;

    @Column(name = "conclusion", columnDefinition = ("varchar(255) not null comment '结论'"))
    private String conclusion;

    @Column(name = "description", columnDefinition = ("varchar(255) default null comment '描述'"))
    private String description;
}
